<?php


namespace app\common\controller;

use app\common\helper\MenuHelper;
use app\common\model\Arctype;
use app\common\model\Country;
use app\common\model\GoodsCategory;
use app\common\model\PartsCategory;
use app\common\model\User;
use think\facade\Request;
use think\facade\View;
use app\common\model\Arctype as ArctypeModel;
class IndexBase extends Base
{
    public $tid; // 栏目id arctype id
    public $aid; // 内容id product image article id
    public $cid; // 频道id channel id
    public $pid;
    protected $user;

    public function initialize()
    {

        parent::initialize(); // TODO: Change the autogenerated stub
        $user = session("user");
        if ($user) {
            $user = User::find($user["id"]);
        }
        $this->user = $user;
        View::assign("user",$user);

        // tid 栏目ID  aid 内容ID  cid 频道ID
        $this->tid = input('param.tid/d',0);
        $this->aid = input('param.aid/d',0);
        $this->cid = input('param.cid/d',0);
        $this->pid = input('param.pid/d',0);
        $idList = [
            'tid' => $this->tid,
            'aid' => $this->aid,
            'cid' => $this->cid
        ];
        View::assign('idList', $idList);
        View::assign('hover', '');
    
        // 动态设置 模板路径
        View::config(['view_path'=>$this->view_path]);

    }
}